package com.shop.shard.service.user.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shop.shard.entity.user.User;
import com.shop.shard.mapper.user.UserMapper;
import com.shop.shard.service.user.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;

/**
* @Description: TODO
* @author:
* @Createed Date: 2018/11/21-10:26
* @ModificationHistory: Who  When  What
* ---------     -------------   --------------------------------------
**/

@Service
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public void delete(Long id) {
        userMapper.deleteById(id);
    }

    @Override
    public void addEntity(User entity) {
        save(entity);
//        userMapper.save(entity);
    }

    @Override
    public void updateEntity(User entity) {
        userMapper.updateById(entity);
    }
}